import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'

// 转rem
import 'lib-flexible/flexible.js'

import Icon from 'vant';
import 'vant/lib/button/style';          //引入样式
import 'vant/lib/index.css';
Vue.use(Icon)

// import Button from 'vant/lib/button';    //引入组件
// import 'vant/lib/button/style';          //引入样式
// Vue.use(Button)   //配置

import { Swipe, SwipeItem,Lazyload,SwipeCell,Popup,Overlay,NoticeBar,SubmitBar ,Checkbox,Button  } from 'vant';
Vue.use(Swipe).use(SwipeItem).use(Lazyload).use(SwipeCell).use(Popup).use(Overlay).use(NoticeBar).use(SubmitBar).use(Checkbox).use(Button);



import Axios from 'axios'
Vue.prototype.axios=  Axios;



// 图片懒加载配置
// main.js 文件
import VueLazyload from 'vue-lazyload'
// Vue.use(VueLazyload) //无配置项
// 配置项
const loadimage = require('@/assets/img/common/loading.gif')
// const loadimage = require('/img/loading.gif')
// const errorimage = require('assets/img/common/error.gif')
Vue.use(VueLazyload, {
  preLoad: 1.3, //预加载的宽高比
  loading: loadimage, //图片加载状态下显示的图片
  // error: errorimage, //图片加载失败时显示的图片
  attempt: 1, // 加载错误后最大尝试次数
})
// img元素上使用v-lazy="src";<img v-lazy="showImage"/>




Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
